import Vue from 'vue'
import Router from 'vue-router'
import Index from './views/index'
import City from './views/city'
import MoreList from './views/more/moreList'
import Search from './views/search/search'
import Detail from './views/detail/detail'
import CartList from './views/cartlist/cartlist'

Vue.use(Router)

export default new Router({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      name: 'index',
      component: Index
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
    },
    {
      path: '/city',
      name: 'city',
      component: City
    },
    {
      path: '/more',
      name: 'moreList',
      component: MoreList
    },
    {
      path: '/search',
      name: 'search',
      component: Search
    },
    {
      path: '/detail',
      name: 'detail',
      component: Detail
    },
    {
      path: '/cartlist',
      name: 'cartlist',
      component: CartList
    }
  ]
})
